<template>
	<view>
		<!-- 登录弹窗 -->
		<view class="loginPopup">
			<view class="loginBox">
				<view class="title">绑定手机号</view>
				<image class="logo" src="/static/icon2/login-tips.png"></image>
				<view class="description">请点击下方按钮，快速绑定</view>
			</view>
			<!-- <button type="primary" open-type="getUserInfo" @getuserinfo="getuserinfo">授权登录</button> -->
			<view class="btn">
				<u-button type="success" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">绑定手机号</u-button>
				<!-- <button class="u-reset-button" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"></button> -->
			</view>
		</view>
	</view>
</template>
<script>
export default {
	data() {
		return {
			iv:'',
			encryptedData:''
		};
	},
	methods: {
		getPhoneNumber(e){
			if('getPhoneNumber:ok' == e.detail.errMsg){
				this.$u.api.bindMobile({
					encryptedData:e.detail.encryptedData,
					iv:e.detail.iv
				}).then(res=>{
					this.$emit('close')
				})
			}
		}
	}
}
</script>

<style lang="scss" scoped>
// .loginMask {
// 	position: fixed;
// 	top: 0rpx;
// 	left: 0rpx;
// 	right: 0rpx;
// 	bottom: 0rpx;
// 	background-color: rgba(0, 0, 0, .06);
// 	z-index: 10;
// }
.loginPopup {
	// position: fixed;
	// top: 50%;
	// left: 50%;
	// transform: translateX(-50%) translateY(-50%);
	width: 600rpx;
	background-color: #fff;
	border-radius: 20rpx;
	overflow: hidden;
	z-index: 11;
	padding-bottom: 40rpx;

	.loginBox {
		display: flex;
		flex-direction: column;
		align-items: center;

		.logo {
			width: 240rpx;
			height: 240rpx;
			padding: 46rpx;
		}

		.title {
			font-size: 36rpx;
			color: #333;
			font-weight: bold;
			line-height: 100rpx;
		}

		.description {
			margin: 10rpx 0 30rpx;
			font-size: 30rpx;
			color: #333;
		}
	}
	.btn{padding: 0 30rpx;}
}
</style>
